package com.repair.auth.pojo.vo;

import com.repair.api.worker.response.data.WorkerInfo;
import com.repair.satoken.utils.StpKit;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * Created by IntelliJ IDEA.
 *
 * @author zq
 * @version 1.0
 * @create 2024-09-29 15:36
 * @since jdk1.8
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WorkerLoginVO implements Serializable {
    private static final long serialVersionUID = 1L;

    private Long id;

    private String token;

    private Long tokenExpiration;

    public WorkerLoginVO(WorkerInfo workerInfo) {
        this.id = workerInfo.getId();
        this.token = StpKit.WORKER.getTokenValue();
        this.tokenExpiration = StpKit.WORKER.getTokenActiveTimeout();
    }
}
